<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>

<%@ page import="com.msmall.base.util.ConstantDB" language="java"%>
<c:set var="AVALIABLE" value="<%=ConstantDB.AVALIABLE%>"></c:set>
<c:set var="UNAVALIABLE" value="<%=ConstantDB.UNAVALIABLE%>"></c:set>

<c:set var="COMMEND_DISPLAY_0" value="<%=ConstantDB.COMMEND_DISPLAY_0%>"></c:set>
<c:set var="COMMEND_DISPLAY_1" value="<%=ConstantDB.COMMEND_DISPLAY_1%>"></c:set>
<c:set var="COMMEND_DISPLAY_2" value="<%=ConstantDB.COMMEND_DISPLAY_2%>"></c:set>
<c:set var="COMMEND_DISPLAY_3" value="<%=ConstantDB.COMMEND_DISPLAY_3%>"></c:set>
<c:set var="COMMEND_DISPLAY_4" value="<%=ConstantDB.COMMEND_DISPLAY_4%>"></c:set>
<c:set var="COMMEND_DISPLAY_5" value="<%=ConstantDB.COMMEND_DISPLAY_5%>"></c:set>
<c:set var="COMMEND_DISPLAY_6" value="<%=ConstantDB.COMMEND_DISPLAY_6%>"></c:set>
<c:set var="COMMEND_DISPLAY_7" value="<%=ConstantDB.COMMEND_DISPLAY_7%>"></c:set>
<c:set var="COMMEND_DISPLAY_8" value="<%=ConstantDB.COMMEND_DISPLAY_8%>"></c:set>
<c:set var="COMMEND_DISPLAY_9" value="<%=ConstantDB.COMMEND_DISPLAY_9%>"></c:set>
<c:set var="COMMEND_DISPLAY_10" value="<%=ConstantDB.COMMEND_DISPLAY_10%>"></c:set>
<c:set var="COMMEND_DISPLAY_11" value="<%=ConstantDB.COMMEND_DISPLAY_11%>"></c:set>
<c:set var="COMMEND_DISPLAY_12" value="<%=ConstantDB.COMMEND_DISPLAY_12%>"></c:set>
<c:set var="COMMEND_DISPLAY_13" value="<%=ConstantDB.COMMEND_DISPLAY_13%>"></c:set>
<c:set var="COMMEND_DISPLAY_14" value="<%=ConstantDB.COMMEND_DISPLAY_14%>"></c:set>
<c:set var="COMMEND_DISPLAY_15" value="<%=ConstantDB.COMMEND_DISPLAY_15%>"></c:set>
<c:set var="COMMEND_DISPLAY_16" value="<%=ConstantDB.COMMEND_DISPLAY_16%>"></c:set>
<c:set var="COMMEND_DISPLAY_17" value="<%=ConstantDB.COMMEND_DISPLAY_17%>"></c:set>
<c:set var="COMMEND_DISPLAY_18" value="<%=ConstantDB.COMMEND_DISPLAY_18%>"></c:set>
<c:set var="COMMEND_DISPLAY_19" value="<%=ConstantDB.COMMEND_DISPLAY_19%>"></c:set>
<c:set var="COMMEND_DISPLAY_20" value="<%=ConstantDB.COMMEND_DISPLAY_20%>"></c:set>
<c:set var="COMMEND_DISPLAY_21" value="<%=ConstantDB.COMMEND_DISPLAY_21%>"></c:set>
<c:set var="COMMEND_DISPLAY_22" value="<%=ConstantDB.COMMEND_DISPLAY_22%>"></c:set>
<c:set var="COMMEND_DISPLAY_23" value="<%=ConstantDB.COMMEND_DISPLAY_23%>"></c:set>
<c:set var="COMMEND_DISPLAY_24" value="<%=ConstantDB.COMMEND_DISPLAY_24%>"></c:set>
<c:set var="COMMEND_DISPLAY_25" value="<%=ConstantDB.COMMEND_DISPLAY_25%>"></c:set>

<c:set var="COMMEND_TYPE_BBS_TOPIC" value="<%=ConstantDB.COMMEND_TYPE_BBS_TOPIC%>"></c:set>
<c:set var="COMMEND_TYPE_SPACE_BLOG" value="<%=ConstantDB.COMMEND_TYPE_SPACE_BLOG%>"></c:set>
<c:set var="COMMEND_TYPE_QUESTION" value="<%=ConstantDB.COMMEND_TYPE_QUESTION%>"></c:set>
<c:set var="COMMEND_TYPE_KLG" value="<%=ConstantDB.COMMEND_TYPE_KLG%>"></c:set>

<c:set var="COMMEND_LEVEL_TOPEST" value="<%=ConstantDB.COMMEND_LEVEL_TOPEST%>"></c:set>
<c:set var="COMMEND_LEVEL_MIDDLE" value="<%=ConstantDB.COMMEND_LEVEL_MIDDLE%>"></c:set>
<c:set var="COMMEND_LEVEL_LOW" value="<%=ConstantDB.COMMEND_LEVEL_LOW%>"></c:set>
<c:set var="AUDIT_NONE" value="<%=ConstantDB.AUDIT_NONE%>"></c:set>
<c:set var="AUDIT_TODO" value="<%=ConstantDB.AUDIT_TODO%>"></c:set>
<c:set var="AUDIT_PASS" value="<%=ConstantDB.AUDIT_PASS%>"></c:set>
<c:set var="AUDIT_REJECT" value="<%=ConstantDB.AUDIT_REJECT%>"></c:set>
<div>
	<form id="f_commend" action="<c:url value='/admin/commend/save.do'/>" method="post" enctype="multipart/form-data">
		<input type="hidden" name="commend.commendId" value="${commend.commendId}">
		<table id="t_commend_detail">
			<tr>
				<th width="75px">来源类型</th>
				<td>
					<select name="commend.commendType">
						<option value="${COMMEND_TYPE_BBS_TOPIC}" <c:if test="${commend.commendType == COMMEND_TYPE_BBS_TOPIC}">selected="selected"</c:if>>BBS TOPIC</option>
						<option value="${COMMEND_TYPE_SPACE_BLOG}" <c:if test="${commend.commendType == COMMEND_TYPE_SPACE_BLOG}">selected="selected"</c:if>>SPACE BLOG</option>
						<option value="${COMMEND_TYPE_QUESTION}" <c:if test="${commend.commendType == COMMEND_TYPE_QUESTION}">selected="selected"</c:if>>Question</option>
						<option value="${COMMEND_TYPE_KLG}" <c:if test="${commend.commendType == COMMEND_TYPE_KLG}">selected="selected"</c:if>>KLG</option>
					</select>
				</td>
			</tr>
			<tr>
				<th width="75px">信息</th>
				<td>
					<c:if test="${commend.commendType == COMMEND_TYPE_BBS_TOPIC}">
						<ms:title entity="${commend.entityId}" type="topic"></ms:title>
					</c:if>
					<c:if test="${commend.commendType == COMMEND_TYPE_SPACE_BLOG}">
						<ms:title entity="${commend.entityId}" type="blog"></ms:title>
					</c:if>
					<c:if test="${commend.commendType == COMMEND_TYPE_QUESTION}">
						<ms:title entity="${commend.entityId}" type="question"></ms:title>
					</c:if>
					<c:if test="${commend.commendType == COMMEND_TYPE_KLG}">
						<ms:klg action="typeNameAll" id="${commend.entityId}"></ms:klg><br/>
						<ms:title entity="${commend.entityId}" type="klg"></ms:title>
					</c:if>
				</td>
			</tr>
			<tr>
			<th width="75px">显示位置</th>
				<td>
					<select name="commend.commendDisplay">
						<option value="${COMMEND_DISPLAY_0}" <c:if test="${commend.commendDisplay == COMMEND_DISPLAY_0}">selected="selected"</c:if>>默认值,需要修改否则不可使用</option>
						
						<option value="${COMMEND_DISPLAY_19}" <c:if test="${commend.commendDisplay == COMMEND_DISPLAY_19}">selected="selected"</c:if>>网站首页滚动图片，从BBS获得</option>
						<option value="${COMMEND_DISPLAY_20}" <c:if test="${commend.commendDisplay == COMMEND_DISPLAY_20}">selected="selected"</c:if>>网站首页大标题新闻，从BBS获得</option>
						<option value="${COMMEND_DISPLAY_21}" <c:if test="${commend.commendDisplay == COMMEND_DISPLAY_21}">selected="selected"</c:if>>网站首页大标题新闻下小标题，从BBS获得</option>
						<option value="${COMMEND_DISPLAY_22}" <c:if test="${commend.commendDisplay == COMMEND_DISPLAY_22}">selected="selected"</c:if>>网站首页大标题新闻下小标题图片，从BBS获得</option>
						
						<option value="${COMMEND_DISPLAY_23}" <c:if test="${commend.commendDisplay == COMMEND_DISPLAY_23}">selected="selected"</c:if>>网站首页Hot最右边图片，从BBS获得</option>
						<option value="${COMMEND_DISPLAY_24}" <c:if test="${commend.commendDisplay == COMMEND_DISPLAY_24}">selected="selected"</c:if>>网站首页BBS标题新闻，从BBS获得</option>
						<option value="${COMMEND_DISPLAY_25}" <c:if test="${commend.commendDisplay == COMMEND_DISPLAY_25}">selected="selected"</c:if>>网站首页BBS图片，从BBS获得</option>
						
						<option value="${COMMEND_DISPLAY_1}" <c:if test="${commend.commendDisplay == COMMEND_DISPLAY_1}">selected="selected"</c:if>>BBS首页滚动图片</option>
						<option value="${COMMEND_DISPLAY_2}" <c:if test="${commend.commendDisplay == COMMEND_DISPLAY_2}">selected="selected"</c:if>>BBS首页标题新闻</option>
						<option value="${COMMEND_DISPLAY_13}" <c:if test="${commend.commendDisplay == COMMEND_DISPLAY_13}">selected="selected"</c:if>>BBS首页标题新闻下面的小推荐</option>
						<option value="${COMMEND_DISPLAY_14}" <c:if test="${commend.commendDisplay == COMMEND_DISPLAY_14}">selected="selected"</c:if>>BBS首页公告</option>
						<option value="${COMMEND_DISPLAY_3}" <c:if test="${commend.commendDisplay == COMMEND_DISPLAY_3}">selected="selected"</c:if>>BBS推荐话题</option>
						<option value="${COMMEND_DISPLAY_4}" <c:if test="${commend.commendDisplay == COMMEND_DISPLAY_4}">selected="selected"</c:if>>BBS首页各大版区推荐图片</option>
						<option value="${COMMEND_DISPLAY_5}" <c:if test="${commend.commendDisplay == COMMEND_DISPLAY_5}">selected="selected"</c:if>>BBS首页各大版区推荐图片下的帖子列表</option>
						<option value="${COMMEND_DISPLAY_15}" <c:if test="${commend.commendDisplay == COMMEND_DISPLAY_15}">selected="selected"</c:if>>BBS首页各大版区标题新闻</option>
						<option value="${COMMEND_DISPLAY_16}" <c:if test="${commend.commendDisplay == COMMEND_DISPLAY_16}">selected="selected"</c:if>>BBS首页各大版区标题新闻下的帖子列表</option>
						<option value="${COMMEND_DISPLAY_6}" <c:if test="${commend.commendDisplay == COMMEND_DISPLAY_6}">selected="selected"</c:if>>问答首页图片</option>
						<option value="${COMMEND_DISPLAY_7}" <c:if test="${commend.commendDisplay == COMMEND_DISPLAY_7}">selected="selected"</c:if>>问答首页推荐问题</option>
						<option value="${COMMEND_DISPLAY_8}" <c:if test="${commend.commendDisplay == COMMEND_DISPLAY_8}">selected="selected"</c:if>>妈妈关心的问题</option>
						<option value="${COMMEND_DISPLAY_9}" <c:if test="${commend.commendDisplay == COMMEND_DISPLAY_9}">selected="selected"</c:if>>宝宝关心的问题</option>
						<option value="${COMMEND_DISPLAY_10}" <c:if test="${commend.commendDisplay == COMMEND_DISPLAY_10}">selected="selected"</c:if>>10: 知识主Segment首页推荐图片.comments字段存放segmentid</option>
						<option value="${COMMEND_DISPLAY_11}" <c:if test="${commend.commendDisplay == COMMEND_DISPLAY_11}">selected="selected"</c:if>>11: 知识主Segment首页推荐大标题.comments字段存放segmentid</option>
						<option value="${COMMEND_DISPLAY_12}" <c:if test="${commend.commendDisplay == COMMEND_DISPLAY_12}">selected="selected"</c:if>>12: 知识主Segment首页各子Segment的推荐.comments字段存放子segmentid</option>
						<option value="${COMMEND_DISPLAY_17}" <c:if test="${commend.commendDisplay == COMMEND_DISPLAY_17}">selected="selected"</c:if>>知识中关于妈妈的推荐(网站首页使用)</option>
						<option value="${COMMEND_DISPLAY_18}" <c:if test="${commend.commendDisplay == COMMEND_DISPLAY_18}">selected="selected"</c:if>>知识中关于宝宝的推荐(网站首页使用)</option>
					</select>
				</td>
			</tr>
			<tr>
				<th width="75px">是否可用</th>
				<td>
					<select name="commend.enabled">
						<option value="${AVALIABLE}" <c:if test="${commend.enabled == AVALIABLE}">selected="selected"</c:if>>可用</option>
						<option value="${UNAVALIABLE}" <c:if test="${commend.enabled == UNAVALIABLE}">selected="selected"</c:if>>不可用</option>
					</select>
				</td>
			</tr>
			<tr>
			<th width="75px">推荐时图片</th>
				<td>
					<input type="file" name="image" />
				</td>
			</tr>
			<tr>
			<th width="75px">当前推荐时图片</th>
				<td>
					<input type="text" name="commend.htmlImage" value="${commend.htmlImage}" />
					<br/>
					<img alt="当前推荐时图片" src="${ctx}/${commend.htmlImage}"/>
				</td>
			</tr>
			<tr>
			<th width="75px">推荐等级</th>
				<td>
					<select name="commend.commendLevel">
						<option value="${COMMEND_LEVEL_TOPEST}" <c:if test="${commend.commendLevel == COMMEND_LEVEL_TOPEST}">selected="selected"</c:if>>最高</option>
						<option value="${COMMEND_LEVEL_MIDDLE}" <c:if test="${commend.commendLevel == COMMEND_LEVEL_MIDDLE}">selected="selected"</c:if>>中级</option>
						<option value="${COMMEND_LEVEL_LOW}" <c:if test="${commend.commendLevel == COMMEND_LEVEL_LOW}">selected="selected"</c:if>>低</option>
					</select>
				</td>
			</tr>
			<tr>
			<th width="75px">实体对应的数据库ID</th>
				<td>
					<input type="text" name="commend.entityId" value="${commend.entityId}"/>
				</td>
			</tr>
			<tr>
				<th width="75px">审核状态</th>
				<td>
					<select name="commend.audit">
						<option value="${AUDIT_NONE}" <c:if test="${commend.audit == AUDIT_NONE}">selected="selected"</c:if>>未处理</option>
						<option value="${AUDIT_TODO}" <c:if test="${commend.audit == AUDIT_TODO}">selected="selected"</c:if>>已经处理，但是不确定</option>
						<option value="${AUDIT_PASS}" <c:if test="${commend.audit == AUDIT_PASS}">selected="selected"</c:if>>通过</option>
						<option value="${AUDIT_REJECT}" <c:if test="${commend.audit == AUDIT_REJECT}">selected="selected"</c:if>>不通过</option>
					</select>
				</td>
			</tr>
			<tr>
			<th width="75px">推荐人</th>
				<td>
					<input type="hidden" name="commend.commender" value="${commend.commender}"/>
					${commend.commender}
				</td>
			</tr>
			<tr>
			<th width="75px">推荐时间</th>
				<td>
					<input type="hidden" name="commend.commendTime" value="${commend.commendTime}"/>
					<fmt:formatDate value="${commend.commendTime}" pattern="yyyy-MM-dd"/>
				</td>
			</tr>
			<tr>
			<th width="75px">推荐备注</th>
				<td>
					<textarea rows="6" cols="20" name="commend.comments">${commend.comments}</textarea>
				</td>
			</tr>
			<tr>
			<th width="75px">显示URL</th>
				<td>
					<input type="text" name="commend.url" value="${commend.url}"/>
				</td>
			</tr>
			<tr>
			<th width="75px">审核人</th>
				<td>
					<input type="text" name="commend.auditor" value="${commend.auditor}"/>
				</td>
			</tr>
			<tr>
			<th width="75px">审核时间</th>
				<td>
					<input type="hidden" name="commend.auditTime" value="${commend.auditTime}"/>
					<fmt:formatDate value="${commend.auditTime}" pattern="yyyy-MM-dd"/>
				</td>
			</tr>
			<tr>
			<th width="75px">审核备注</th>
				<td>
					<textarea rows="6" cols="20" name="commend.reason">${commend.reason}</textarea>
				</td>
			</tr>
			<tr>
				<td><input type="submit" name="保存" value="保存"/></td>
			</tr>
		</table>
	</form>
</div>
